﻿using UnityEngine;
using UnityEditor;
using System.Collections;

public class AssetbundlesMenuItems
{
	const string kSimulateAssetBundlesMenu = "AssetBundles/Simulate AssetBundles";

	[MenuItem(kSimulateAssetBundlesMenu)]
	public static void ToggleSimulateAssetBundle ()
	{
		AssetBundleManager.SimulateAssetBundleInEditor = !AssetBundleManager.SimulateAssetBundleInEditor;
	}        

    [MenuItem(kSimulateAssetBundlesMenu, true)]
	public static bool ToggleSimulateAssetBundleValidate ()
	{
		Menu.SetChecked(kSimulateAssetBundlesMenu, AssetBundleManager.SimulateAssetBundleInEditor);
		return true;
	}

    const string UnRecordSimulateMenuName = "AssetBundles/UnRecordSimulate";
    [MenuItem(UnRecordSimulateMenuName)]
    public static void ToggleUnRecordSimulate()
    {
        AssetBundleManager.IsUnRecordSimulate = !AssetBundleManager.IsUnRecordSimulate;
    }

    [MenuItem(UnRecordSimulateMenuName, true)]
    public static bool ToggleUnRecordSimulateValidate()
    {
        Menu.SetChecked(UnRecordSimulateMenuName, AssetBundleManager.IsUnRecordSimulate);
        return true;
    }

    [MenuItem ("AssetBundles/Refresh AssetBundleName")]
	static public void RefreshAssetBundleName ()
	{
		BuildScript.ResetUsedAssetBundleNames();
	}
	
	[MenuItem ("AssetBundles/Build AssetBundles")]
	static public void BuildAssetBundles ()
	{
        //lua文件拷贝到Res中
        //ToLuaMenu.CopyLuaFilesToRes();
        //BuildAssetBundle
        BuildScript.BuildAssetBundles();
	}

    //[MenuItem ("AssetBundles/Build Player")]
    //static void BuildPlayer ()
    //{
    //    BuildScript.BuildPlayer();
    //}
}
